package newPan3d.content.scene
{
	import _Pan3D.core.MathCore;
	
	import _me.Scene_data;
	
	import com.adobe.utils.PerspectiveMatrix3D;
	
	import flash.display3D.Context3D;
	import flash.display3D.Context3DBlendFactor;
	import flash.display3D.Context3DCompareMode;
	import flash.display3D.Context3DProgramType;
	import flash.display3D.Context3DTriangleFace;
	public class PanSceneLevel extends SceneLevel
	{
		public function PanSceneLevel()
		{
			super();
		}
		override public function upData():void
		{
			if (!Scene_data.ready)
				return;
			
			//Scene_data.focus3D.angle_x=-90;
			
			var lookAt:Boolean=false
			_lightMenager.updata(lookAt);
			if(lookAt){
				return;
			}
			var context3D:Context3D=Scene_data.context3D;
			
			MathCore._catch_cam(Scene_data.cam3D, Scene_data.focus3D);
			context3D.clear(0, 0, 0, 1);
			_projMatrix=new PerspectiveMatrix3D();
			_projMatrix.perspectiveFieldOfViewLH(1, 1, 0.1, 9000);
			context3D.setProgramConstantsFromMatrix(Context3DProgramType.VERTEX, 0, _projMatrix, true);
			context3D.setBlendFactors(Context3DBlendFactor.ONE, Context3DBlendFactor.ZERO);
			context3D.setDepthTest(true, Context3DCompareMode.LESS);
			_groundView.upData();
			context3D.setDepthTest(true, Context3DCompareMode.ALWAYS);
			//_groundUpLevel.upData();
			context3D.setDepthTest(true, Context3DCompareMode.LESS);
			_buildView.upData();
			_treeLevel.upData();
			_heorLevle.upData();
			_glassLevel.upData();
			_npcLevel.upData();
			//_luoYeLevel.upData();
	
			context3D.setCulling(Context3DTriangleFace.NONE);
			context3D.setBlendFactors(Context3DBlendFactor.SOURCE_ALPHA, Context3DBlendFactor.ONE_MINUS_SOURCE_ALPHA);
			context3D.setDepthTest(false, Context3DCompareMode.LESS);
			_huoqiuLevel.upData();
			_frieLevel.upData();
			
			context3D.present();
			SceneMenager.makelight3D();
			
			
			
		}
	}
}